/*
 * @Author: Zhang Kai
 * @Date: 2021-11-24 10:40:27
 * @LastEditors: mayijun
 * @LastEditTime: 2022-05-25 15:51:26
 * @FilePath: /metricsx-standard-ui/src/components/Arithmetic/components/ArithmeticDetail.tsx
 */
/* 运算逻辑Select详情 */
export default (props: any) => {
  const { list } = props;
  return (
    <div class="ArithmeticSelectInfo">
      <div class="ArithmeticSelectInfo-container">
        {list?.map((v: any, index: any) => {
          let rtn;
          if (v.value) {
            rtn = (
              <div key={`tip_${index}`}>
                <div class="ArithmeticSelectInfo-label">{v.label}</div>
                <div class="ArithmeticSelectInfo-info">
                  {Array.isArray(v.value) ? (
                    v.value.map((obj: any, idx: any) => (
                      <div key={`tip_value${idx}`}><span class="name">{obj.name}</span>{obj.value || ''}</div>
                    ))
                  ) : (
                    <div key={`tip_value_${index}`}>{v.value || ''}</div>
                  )}
                </div>
              </div>
            );
          }
          return rtn || null;
        })}
      </div>
    </div>
  );
};
